var rightsManagement={
    init:function(){
        var self=this;
        self.shadeDiv = $("#shade-div");
        self.bindEvents();

    },
    bindEvents:function(){
        var self=this;

//        添加权限
        $("#addRights").click(function(){
            self.shadeDiv.show();
            $("#newlyAdded").setPosition().show();
        })

//        修改权限
        $(".edit").click(function(){
            self.shadeDiv.show();
            $("#editRights").setPosition().show();
        })
//        删除
        $(".delete").click(function(){
            self.shadeDiv.show();
            $('#warning').setPosition().show().find("p.center").html("确定要删除吗？");

        });


    },

    ajaxGET:function (url, data, fn,beforeSendFn) {
        var beforeSendFn = beforeSendFn || function(){};
        $.ajax({type:"GET", dataType:'json', context:this, url:url, data:data, success:fn, beforeSend:beforeSendFn});
    },
    ajaxPOST:function (url, data, fn,beforeSendFn) {
        var beforeSendFn = beforeSendFn || function(){};
        $.ajax({type:"POST", dataType:'json', context:this, url:url, data:data, success:fn, beforeSend:beforeSendFn});
    }

}
$(function(){
    rightsManagement.init();
})